package com.victor.common.core.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum AssessProcessEnum {
    PROCESS_1("1", "开始评估"),
    PROCESS_2_1("2-1", "获取评估数据成功"),
    PROCESS_2_2("2-2", "获取评估数据失败"),
    //PROCESS_3_1("3-1", "评估发送成功"),
    //PROCESS_3_2("3-2", "评估发送失败"),
    PROCESS_4_1("4-1", "获取评估结果成功"),
    PROCESS_4_2("4-2", "获取评估结果失败"),
    PROCESS_4_3("4-3", "保存评估结果失败"),
    PROCESS_5("5", "评估完成");

    @EnumValue
    private final String code;

    @JsonValue
    private final String value;

    public static String getByCode(String code) {
        for (AssessProcessEnum assessProcessEnum : AssessProcessEnum.values()) {
            if (assessProcessEnum.code.equals(code)) {
                return assessProcessEnum.value;
            }
        }
        return null;
    }
}
